#include<stdio.h>
#include<string.h>
#ifdef _MSC_VER
#include<WinSock2.h>
#else
#include <arpa/inet.h>
#endif

#include"tools.h"

void Data_uint2bin(unsigned int value, unsigned char *buff)
{
	value = htonl(value);
	memcpy(buff, &value, sizeof(value));

	return;
}

unsigned int Data_bin2uint(unsigned char *buff)
{
	unsigned int value;

	memcpy(&value, buff, sizeof(value));
	value = ntohl(value);
	return value;
}